<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const person = { name: 'Lydia' }

        function sayHi(age) {
            console.log(`${this.name} is ${age}`)
        }
        // .call 是立即执行的  .bind 返回函数的副本
        sayHi.call(person, 21) // Lydia is 21
        sayHi.bind(person, 21) // function
        var status = "😎"

        setTimeout(() => {
            const status = "😍"

            const data = {
                status: "🥑",
                getStatus() {
                    return this.status
                }
            }
            // 🥑 😎
            console.log(data.getStatus())
            console.log(data.getStatus.call(this))
        }, 0)
    </script>
</body>

</html>